package com.woniu.controller;

import cn.dev33.satoken.util.SaResult;
import com.woniu.entity.AllMenu;
import com.woniu.entity.AllUser;
import com.woniu.service.AllMenuService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author zhaoj
 * @Date 2025/6/16 03:46
 * @Description TODO
 **/
@RestController
@RequestMapping("/menu")
public class AllMenuController {
    @Resource
    private AllMenuService AllMenuService;

    @PostMapping("/get")
    public SaResult get(@RequestBody AllUser user) {
        List<AllMenu> menu = AllMenuService.getById(user.getUserId());
        return SaResult.ok().setData(menu);
    }
    @PostMapping("/route")
    public SaResult route(@RequestBody AllUser user) {
        List<AllMenu> menu = AllMenuService.getRouteById(user.getUserId());
        return SaResult.ok().setData(menu);
    }
}
